<script setup>
//1:导入我们的store仓库方法
import { useCounterStore } from '@/store/counter';
import { onMounted } from 'vue';
//2:调用仓库中的action方法
const counterStore = useCounterStore();
counterStore.increment();
//生命周期函数发起请求
onMounted(()=>{
  counterStore.getList();
})
</script>
<template>
  <button @click="counterStore.increment">{{ counterStore.count }}</button>
  <!-- 使用我们定义的的getters -->
  {{ counterStore.doubleCount }}
  <p>
    name={{counterStore.name}}
  </p>
</template>
<style scoped>
</style>
